package Demo513;

import java.io.*;

public class TestFile {
    public void SetData(String filename,String data ) throws IOException {
        FileWriter fileWriter = new FileWriter(filename);
        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
        bufferedWriter.write(data);
        bufferedWriter.close();
    }

    public void GetData(String filename) throws IOException {
        FileReader fileReader = new FileReader(filename);
        BufferedReader bufferedReader = new BufferedReader(fileReader);

        String data;
        while((data = bufferedReader.readLine()) != null)
        {
            System.out.println(data);
        }


    }
}
